import 'package:json_annotation/json_annotation.dart';

part 'news_model.g.dart';

@JsonSerializable()
class NewsPageData {
  int? total;
  List<NewsModel>? list;
  NewsPageData();

  factory NewsPageData.fromJson(Map<String, dynamic> json) =>
      _$NewsPageDataFromJson(json);
  Map<String, dynamic> toJson() => _$NewsPageDataToJson(this);
}

@JsonSerializable()
class NewsModel {
  int? id;
  int? ebike_id;
  String? ebike_name;
  int? message_type;
  String? title;
  String? content;
  int? flag; //已读未读
  String? extend;
  String? frame_code;
  int? relation_id;
  int? created_at;
  int? updated_at;
  NewsModel();

  factory NewsModel.fromJson(Map<String, dynamic> json) =>
      _$NewsModelFromJson(json);
  Map<String, dynamic> toJson() => _$NewsModelToJson(this);
}
